import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Demo9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true){
            String str1 = scanner.nextLine();
            ArrayList<Integer> A = mySplit(str1);
            String str2 = scanner.nextLine();
            ArrayList<Integer> B= mySplit(str2);
            int muns = scanner.nextInt();
            int P = scanner.nextInt();
            System.out.println(outTrue(A, B, muns, P));
            scanner.nextLine();
        }
    }

    private static int outTrue(ArrayList<Integer> a, ArrayList<Integer> b, int muns, int p) {
        int count = 0;
        int aSize = a.size()-1;
        int aPer = 0;
        int bSize = b.size()-1;
        int bPer = 0;
        a.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                //因为数字最大不超过100
                return o1-o2;
            }
        });
        b.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                //因为数字最大不超过100
                return o1-o2;
            }
        });
        while (bSize >= bPer){
            if (b.get(bSize) > a.get(aSize)){
                count++;
                aSize--;
                bSize--;
            }else{
                if (muns > 0){
                    if (b.get(bSize) + p > a.get(aSize)){
                        count++;
                        aSize--;
                        bSize--;
                        p--;
                    }else {
                        bPer++;
                        aSize--;
                    }
                }else {
                    bPer++;
                    aSize--;
                }
            }
        }
        return count;
    }

    private static ArrayList<Integer> mySplit(String str) {
        String sub = str.substring(1,str.length()-1);
        String[] arr = sub.split(",");
        ArrayList<Integer> arrayList = new ArrayList<>();
        for (int i = 0; i < arr.length; i++) {
            arrayList.add(Integer.parseInt(arr[i]));
        }
        return arrayList;
    }
}
